// import React from 'react'
// import { Route, Redirect, Switch } from 'react-router-dom';
// import Home from './Home';
// import Category from './Category'
// import Detail from './Detail'
// type Props = {}

// // switch 组件每次保证路由相同的路由只能匹配一个. 如果有一个路由匹配成功, 就不会向下匹配了
// export default function Index({ }: Props) {
//     return (
//         <Switch>
//             <Route path='/home' component={Home}></Route>
//             <Route path='/categpry' component={Category}></Route>
//             <Route path='/detail/:id' component={Detail}></Route>
//             <Redirect from='/' to='/home' exact></Redirect>
//         </Switch>
//     )
// }